import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      component: () => import('../views/Login.vue')
    },
    {
      path: '/layout',
      component: () => import('../views/Layout.vue'),
      children:[
        {
          path:'/layout/home',
          meta:{title:'首页'},
          component: () => import('../views/Layout.vue'),
        },
        {
          path:'/layout/pro',
          meta:{title:'产品管理'},
          component: () => import('../views/Production.vue'),
        }
        ,
        {
          path:'/layout/store',
          meta:{title:'门店管理'},
          component: () => import('../views/Store.vue'),
        }
        ,
        {
          path:'/layout/vip',
          meta:{title:'会员管理'},
          component: () => import('../views/Vip.vue'),
        }
        ,
        {
          path:'/layout/order',
          meta:{title:'订单管理'},
          component: () => import('../views/Order.vue'),
        }
        ,
        {
          path:'/layout/sys',
          meta:{title:'系统管理'},
          component: () => import('../views/sys/System.vue'),
        }
      ]
    }
  ]
})

export default router
